import request from '@/utils/request'

// 查询学生请假申请列表
export function listLeaveApplication(query) {
  return request({
    url: '/routine/leaveApplication/list',
    method: 'get',
    params: query
  })
}

export function getListLeaveApplication(query) {
  return request({
    url: '/routine/leaveApplication/getList',
    method: 'get',
    params: query
  })
}

// 查询学生请假申请详细
export function getLeaveApplication(leaveApplicationId) {
  return request({
    url: '/routine/leaveApplication/' + leaveApplicationId,
    method: 'get'
  })
}

// 根据流程id查询学生请假申请详细
export function getLeaveApplicationByProcInsId(procInsId) {
  return request({
    url: '/routine/leaveApplication/getLeaveApplicationByProcInsId/' + procInsId,
    method: 'get'
  })
}

// 新增学生请假申请
export function addLeaveApplication(data) {
  return request({
    url: '/routine/leaveApplication/add',
    method: 'post',
    data: data
  })
}

// 修改学生请假申请
export function updateLeaveApplication(data) {
  return request({
    url: '/routine/leaveApplication/update',
    method: 'post',
    data: data
  })
}

// 删除学生请假申请
export function delLeaveApplication(leaveApplicationId) {
  return request({
    url: '/routine/leaveApplication/' + leaveApplicationId,
    method: 'post'
  })
}

// 获取学生信息
export function getStuInfo() {
  return request({
    url: '/routine/leaveApplication/getStuInfo',
    method: 'get'
  })
}

// 根据stuid获取学生信息
export function getStuInfoByStuId(stuNo) {
  return request({
    url: '/routine/leaveApplication/getStudentInfoByStuId/' + stuNo,
    method: 'get'
  })
}

// 保存
export function save(data) {
  return request({
    url: '/routine/leaveApplication/save',
    method: 'post',
    data: data
  })
}
